<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../plugins/JQuery/jquery-2.1.1.min.js"></script>
    <script src="../plugins/Bootstrap/js/bootstrap.js"></script>
    <link rel="stylesheet" href="../plugins/Bootstrap/css/bootstrap.css">
    <!--线上css-->
   <!-- <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet">-->
    <style>
        #div6{
            margin-left: 190px;
            /*border: red solid 1px;*/
            width: 700px;

            /* 鼠标移入变小手 */
            cursor: pointer;
        }
        .div6_1{
            /*border: red solid 1px;*/
            /*background-color: #fafafa;*/
            float: left;
            width: 200px;
            height: 150px;
            margin-top: 30px;
            margin-left: 13px;
            margin-right: 13px;
            margin-bottom: 10px;
        }
        .div6_1:hover{
            transform: scale(1.02);
        }
    </style>
    <script>

        function saveSId(storeId){
            $.ajax({
                url:'/taobei_web/Store/saveStoreId',
                data:{
                    storeId:storeId
                },
                dataType:'json',
                success:function (respBean) {
                    if (respBean.status == 500) {
                        alert(respBean.msg)
                    }
                    else {
                        location.href="updateIProduceIndex.html";
                    }
                }
            })
        }

        function registerStore(){
            location.href="registerStore.html";
        }

        $(function () {
            //提交事件发送ajax请求
            $.ajax({
                url:'/taobei_web/Store/queryStoreBySessionId',
                dataType:'json',
                success:function (respBean) {
                    if (respBean.status==500){
                        alert(respBean.msg)
                    } else {
                        let text="";
                        for (let i = 0; i < respBean.data.length; i++) {

                            if(respBean.data[i].flag==1) {
                                text += "<div class=\"div6_1\" onclick='saveSId("+respBean.data[i].id+")'>";
                                text +="<div><img src='"+respBean.data[i].imgUrl+"' style=\"width: 200px;height: 133px\"/></div>";
                                text +="<div style=\"text-align: center; margin-top: -8px;font-size: 15px\">"+respBean.data[i].name+"</div>"
                                text +="</div>";
                            }
                        }
                        $("#div6").html(text);
                    }
                }
            })
        })
    </script>
</head>
<body>
<h1>请选择店铺</h1>

<div id="div6"></div>
</body>
</html>